/**
 * @author mili
 */

/**
 * Data from Different Categories has different properties
 * So I just separate their access methods
 * */

/**
 * Properties accessed by Category 1
 * */

function getDisplayName(properties){
	
}

function getHeadLine(properties){
	return properties.headline;
}

function isNewIncident(properties){
	return properties.isNewIncident;
}

function getLastUpdateTime(properties){
	
}

function getMainCategory(properties){
	
}

function getRoads(properties){
	return properties.roads;
	// You can parse the roads in the next level using RoadJsonParse.js
}

function getPropertyInfo_Cat1(properties){
	return "Head Line: "+getHeadLine(properties)+"<br>"+getRoadInfo(getRoads(properties));
}

/**
 * Properties accessed by Category 2
 * */

function isActive(properties){
	return properties.isActive;
}

function getTravellingTimeMinutes(properties){
	return properties.travelTimeMinutes;
}

function getDirection(properties){
	return properties.direction;
}

function getFromPlace(properties){
	return properties.fromDisplayName;
}

function getToPlace(properties){
	return properties.toDisplayName;
}

/**
 * This method return the info of the given properties.
 * */
function getPropertyInfo_Cat2(properties){
	var ret = "isActive: "+isActive(properties)+"<br>";
	ret += "travelling time: "+getTravellingTimeMinutes(properties)+" min<br>";
	ret += "direction: "+getDirection(properties)+"<br>";
	ret += "from: "+getFromPlace(properties)+"<br>";
	ret += "to: "+getToPlace(properties)+"<br>";
	return ret;
}
